Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ftReceiptTotal #285

Closed

Conversation

LeilaZarban
Copy link
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

{Summary of the changes}

Description

{Detail}

Fixes #{issue number}

@LeilaZarban LeilaZarban requested a review from a team as a code owner May 14, 2024 11:34
@@ -351,7 +351,7 @@ public async Task<ftReceiptJournal> CreateReceiptJournalAsync(ftQueue queue, ftQ
}
else
{
receiptjournal.ftReceiptTotal = (receiptrequest?.cbChargeItems?.Sum(ci => ci.Amount)).GetValueOrDefault();
receiptjournal.ftReceiptTotal = (receiptrequest?.cbChargeItems?.Sum(ci => Math.Sign(ci.Quantity) * ci.Amount)).GetValueOrDefault();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ftReceiptTotal should always be the straight sum of the Amounts. This is due to the definition of how we have specified usage of Amount / chargeitems in the interface docs. Taking the Quantity into the calculation will make the calculation wrong for a lot of cases so we must not change that.

@StefanKert StefanKert closed this Oct 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants